﻿using System;
using GC_RF.BusinessEntities.DTOs;
using GC_RF.Site.Models.News;

namespace GC_RF.Site.Extensions.Models.News
{
	public static class NewsModelEx
	{
		public static NewsData ToNewsData(this NewsModel data)
		{
			if (data == null) return null;

			return new NewsData
			{
				Date = DateTime.Now,
				Description = data.Description,
				Preview = data.Preview,
				ImageUrl = data.ImageUrl,
				Title = data.Title,
				Id = data.Id
			};
		}
	}
}